<!-- View all / Admin / offer / donate / listing -->
<?php include("header.php"); ?>
<article>
	<header><h1>Hi $Name ! Here's how you can help.</h1>
		<p>Placeholder Text:</p>
	</header>

  <?php
  include("functions/database.php");
  $con = mysqli_connect($hostname,$username,$password,$dbname);
  if (mysqli_connect_errno())
    {echo "Failed to connect to MySQL: " . mysqli_connect_error();}
  $result = mysqli_query($con,"SELECT * FROM DonateList ORDER BY ID");
  ?>

	<table id="donatelist">
	  <thead>
	    <tr>
    	<th width="20">D/O</th>
    	<th width="250">Name</th>
	    <th width="250">Location</th>
	    <th width="250">Contact</th>
	    <th width="600">What they're offering</th>
	    <th width="100">Flag</th>
	    <th width="100">Delete</th>
	    </tr>
	  </thead>

	  <tbody>
    
    <?php
    while($row = mysqli_fetch_array($result))
      {
      echo "<tr>";
      echo "<td>D</td>";
      echo "<td>" . $row['Name'] . "</td>";
      echo "<td>" . $row['Location'] . "</td>";
      echo "<td>" . $row['Contact'] . "</td>";
      echo "<td>" . $row['Donation'] . "</td>";
      echo "<td><a>Flag</a></td>";
      echo "<td><a href=\"functions/delete.php?id=" . base64_encode($row['ID']) . "\">Delete</a></td>";
      echo "</tr>";
      }
    echo "</table>";

    ?>

	  </tbody>
	</table>
	<h6 class="half"></h6>

</article>
<?php include("footer.php"); ?>

 